package com.example.car

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.View.OnClickListener
import android.view.Window
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat

class MainActivity : AppCompatActivity(), OnClickListener {
    lateinit var btn1: Button
    lateinit var btn2: Button

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val window: Window = this@MainActivity.window
        window.statusBarColor = ContextCompat.getColor(this@MainActivity, R.color.black)


        btn1 = findViewById(R.id.main_btn1)
        btn2 = findViewById(R.id.main_btn2)

        btn1.setOnClickListener(this)
        btn2.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v) {
            btn1 -> {
                startActivity(Intent(this, NewsActivity::class.java))
            }
            btn2 -> {
                startActivity(Intent(this, LogoActivity::class.java))
            }
        }

    }

}